package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;

/**
 * 个人交易明细交易类型
 */
@EnumDescription("个人交易明细交易类型")
public enum TransactionDetailsTdTypeEnum implements DictEnum {

    //--------------------start-----------------

    /**
     * 充值
     */
    RECHARGE("01","充值"),
    /**
     * 提现
     */
    EMBODY("02","提现"),
    /**
     * 支付
     */
    PAY("03","支付"),
    /**
     * 退费
     */
    REFUND("04","退费"),
    /**
     * 出账
     */
    ENTER_AN_ITEM_OF_EXPENDITURE_IN_THE_ACCOUNTS("05","出账"),
    //--------------------end-------------------
    ;
    private String key;

    private String value;

    TransactionDetailsTdTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }


    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(TransactionDetailsTdTypeEnum.class, value);
        }
    }
}
